/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/
package com.genia.toolbox.portlet.editor;

import java.rmi.server.UID;
import java.util.List;

import com.genia.toolbox.basics.editor.AbstractController;
import com.genia.toolbox.portlet.editor.gui.PortletEditorGUI;
import com.genia.toolbox.portlet.editor.model.bean.PortletInitialSettings;
import com.genia.toolbox.portlet.editor.model.document.impl.DocumentModel;
import com.genia.toolbox.portlet.editor.model.portlet.impl.PortletModel;
import com.genia.toolbox.web.portlet.description.PortletDescription;

/**
 * The portlet editor controller.
 */
public class PortletEditorController
    extends AbstractController<PortletEditorApplication, PortletEditorGUI, DocumentModel, PortletModel, PortletInitialSettings>
{

  /**
   * Constructor.
   * 
   * @param application
   *          The application.
   * @param gui
   *          The gui.
   */
  public PortletEditorController(PortletEditorApplication application, PortletEditorGUI gui)
  {
    super(application, gui);
  }



  /**
   * Notify a document selection.
   * 
   * @param documentUniqueID
   *          the document unique ID.
   */
  public void notifyDocumentSelection(UID documentUniqueID)
  {
    this.getGUI().setSelectedDocument(documentUniqueID);
  }



  /**
   * Return the list of container portlet descriptions.
   * 
   * @return the list of container portlet descriptions.
   */
  public List<PortletDescription> notifyDisplayContainerPortletDescriptions()
  {
    return this.getApplication().getContainerPortletsDescription();
  }



  /**
   * Return the list of simple portlet descriptions.
   * 
   * @return the list of simple portlet descriptions.
   */
  public List<PortletDescription> notifyDisplaySimplePortletDescriptions()
  {
    return this.getApplication().getSimplePortletsDescription();
  }



  /**
   * Return the list of template portlets.
   * 
   * @return the list of template portlets.
   */
  public List<String> notifyDisplayTemplatePortlets()
  {
    return this.getApplication().getTemplatePortlets();
  }



  /**
   * Return the list of portlets.
   * 
   * @return the list of portlets.
   */
  public List<String> notifyDisplayPortlets()
  {
    return this.getApplication().getPortlets();
  }

}
